package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseListResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.order.OrderSubOrderResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.weekwork.*;
import com.zmj.sy.mom.srv.aps.service.WeekWorkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequiredArgsConstructor
@Api(tags = "工作周计划")
@RestController
@RequestMapping("/weekWork")
public class WeekWorkController {

    private final WeekWorkService weekWorkService;

    @ApiOperation("工作周计划查询")
    @GetMapping("/list")
    public WeekWorkResVo getList(WeekWorkReqVo reqVo) {
        return weekWorkService.getlist(reqVo);
    }

    @ApiOperation("工作周计划查询——整加")
    @GetMapping("/zjList")
    public BaseListResVo<WeekWorkInfoVo> getZjList(WeekWorkReqVo reqVo) {
        return weekWorkService.getZjList(reqVo);
    }

    @ApiOperation("工作周计划查询——焊接")
    @GetMapping("/hjList")
    public BaseListResVo<WeekWorkInfoVo> getHjList(WeekWorkReqVo reqVo) {
        return weekWorkService.getHjList(reqVo);
    }

    @ApiOperation("工作周计划查询——配套")
    @GetMapping("/ptList")
    public BaseListResVo<WeekWorkInfoVo> getPtList(WeekWorkReqVo reqVo) {
        return weekWorkService.getPtList(reqVo);
    }

    @ApiOperation("工作周计划查询——下料")
    @GetMapping("/xlList")
    public BaseListResVo<WeekWorkInfoVo> getXlList(WeekWorkReqVo reqVo) {
        return weekWorkService.getXlList(reqVo);
    }

    @ApiOperation("零件计划明细")
    @GetMapping("/planDetail")
    public BaseListResVo<PlanDetailResVo> planDetail(PlanDetailReqVo reqVo) {
        return weekWorkService.planDetail(reqVo);
    }

    @ApiOperation("零件计划明细三角")
    @GetMapping("/planDetailTriangle")
    public BaseListResVo<PlanDetailResVo> planDetailTriangle(PlanDetailTriangleReqVo reqVo) {
        return weekWorkService.planDetailTriangle(reqVo);
    }

    @ApiOperation("工序计划明细")
    @GetMapping("/phaseDetail")
    public BaseListResVo<PhaseDetailResVo> phaseDetail(PhaseDetailReqVo reqVo) {
        return weekWorkService.phaseDetail(reqVo);
    }

    @ApiOperation("获取订单的子包")
    @GetMapping("/subOrder")
    public BaseListResVo<OrderSubOrderResVo> subList(WeekWorkSubOrderReqVo reqVo){

        List<OrderSubOrderResVo> resVo = weekWorkService.subList(reqVo);

        return new BaseListResVo<>(resVo);
    }

}
